7 * (1 + 2 + 3);;
"CS" ^ string_of_int 3110;;

42 / 10;;

3.13 /. 2.;;

assert ("hi" = "hi");;
assert (not ("hi" == "hi"));;

let rec pow x n =
  assert (n > 0);
  if n == 1 then x else x *. (pow x (n - 1));;

pow 4.2 7;;

let month_days: (string * int) list = [("Jan", 31); ("Feb", 29); ("Mar", 31); ("Apr", 30); ("May", 31); ("Jun", 30);
                                       ("Jul", 31); ("Aug", 31); ("Sept", 30); ("Oct", 31);  ("Nov", 30); ("Dec", 31)];;

let date int_d string_m = int_d < snd (List.find (fun x -> (fst x) = string_m) month_days);;

assert (date 29 "Jan");;
assert (not (date 300 "Feb"));;

let rec fib n =
  match n with
      | 0 | 1 -> 1
      | x -> fib (x - 1) + (fib (x - 2))

let quick_fib n =
  let rec fib_inner prev cur idx =
    if idx = n then
      cur
    else
      fib_inner cur (prev + cur) (idx + 1)
  in
  fib_inner 0 1 0;;

quick_fib 0;;
quick_fib 1;;
quick_fib 2;;

let divide (numerator:float)  (denominator:float) = numerator /. denominator;;

let (+/.) x y = (x +. y) /. 2.;;
